<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\index\controller;

use think\App;
use think\Db;


/**
 * 应用入口
 * Class Index
 * @package app\index\controller
 */
class Index extends UserBase
{

    public function __construct(App $app = null)
    {
        parent::__construct($app);
    }

    /**
     * 首页
     * @return mixed
     * @throws \WeChat\Exceptions\InvalidResponseException
     * @throws \WeChat\Exceptions\LocalCacheException
     */
    public function index()
    {
        $this->assignJsSign($this->request->url(true));

        return $this->fetch();
    }



    public function searchJob()
    {
        $searchValue = $this->request->param('searchValue', '');
        $city = $this->request->param('city', '');

        $cityId = Db::name('area')
            ->where('area_name', 'LIKE', '%' . $city . '%')
            ->value('area_id') ?: 0;

        $this->assign('cityId', $cityId);
        $this->assign('city', $city);
        $this->assign('searchValue', $searchValue);

        return $this->fetch();
    }



}
